<!DOCTYPE html>
<html>
<head>
    <title>Fade</title>

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    <div id="example" class="k-content">

    <ul id="listView"></ul>

    <ul id="list"></ul>

    <script type="text/x-kendo-tmpl" id="images-template">
        <li#= typeof done != "undefined" && done ? " class='done'" : "" #>
            <img src="../../content/web/foods/${ProductID}.jpg" alt="${ProductName} image">
        </li>
    </script>

    <script type="text/x-kendo-tmpl" id="list-template">
        <li#= typeof done != "undefined" && done ? " class='done'" : "" #>${ProductName}</li>
    </script>

    <script>
        $(document).ready(function() {
            var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "http://demos.kendoui.com/service/Products",
                            dataType: "jsonp"
                        }
                    },
                    pageSize: 8
                });

            $("#listView").kendoListView({
                autoBind: false,
                dataSource: dataSource,
                template: kendo.template($("#images-template").html())
            });

            $("#list").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#list-template").html())
            });

            $("#listView").on("click", "img", function(e) {
                var el = $(e.currentTarget).closest("li"),
                    effect = kendo.fx(el).fadeOut().duration(700);

                effect.play().then(function() {
                    dataSource.getByUid($(this).attr("data-uid")).set("done", true);
                });
            });
        });
    </script>
    <style>
        #listView, #list {
            position: absolute;
            border: 0;
            background: transparent;
            top: 90px;
            margin: 0;
            padding: 0;
            list-style-type: none;
        }

        #listView {
            left: 50px;
            width: 370px;
        }

        #listView .done {
            display: none;
        }

        #listView li {
            display: inline-block;
            width: 80px;
            height: 80px;
            margin: 0 10px 10px 0;
            -webkit-box-shadow: 0 2px 5px rgba(168,126,68,.8);
            -moz-box-shadow: 0 2px 5px rgba(168,126,68,.8);
            -o-box-shadow: 0 2px 5px rgba(168,126,68,.8);
            box-shadow: 0 2px 5px rgba(168,126,68,.8);
        }

        #listView li,
        #listView img {
            overflow: hidden;
            width: 80px;
            height: 80px;
            cursor: pointer;
            -webkit-border-radius: 40px;
            -moz-border-radius: 40px;
            -o-border-radius: 40px;
            border-radius: 40px;
        }
        
        #listView li:hover {
            -webkit-box-shadow: 0 0 0 3px rgba(255,255,255,.8);
            -moz-box-shadow: 0 0 0 3px rgba(255,255,255,.8);
            -o-box-shadow: 0 0 0 3px rgba(255,255,255,.8);
            box-shadow: 0 0 0 3px rgba(255,255,255,.8);
        }

        #list {
            left: 523px;
            color: #666;
        }

        #list .done {
            text-decoration: line-through;
        }

        #example {
            background: url(../../content/web/fx/groceries.jpg) no-repeat 0 0;
            height: 330px;
        }
    </style>
</div>

</body>
</html>
